import React from 'react'
import View from 'lib/View.jsx'
import dispatcher from 'lib/dispatcher'
import cx from 'classnames'

export default class MultiCheckItem extends View {

  checkHandler () {
    dispatcher.dispatch({
      $type: 'filter_check',
      filterType: this.props.checkType,
      target: {
        value: this.props.item[this.props.itemType],
        label: this.props.checkName + this.props.item.name
      }
    });
  }

  render () {
    return (
      <li style={{'margin': '2px auto'}}>
        <a
          onClick={this.checkHandler.bind(this)}
          style={{
            'padding': '0px 25px',
            'margin': '0px 10px 0px 6px',
            'border': 'none'
          }}>
          {this.props.item.name}
        </a>
      </li>
    );
  }
}

MultiCheckItem.defaultProps = {
  item: null,
  checkType: ''
}
